package com.nexus.all.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * 评论表
 *
 * @ClassName: Comment
 * @Author: ZZYR
 * @Date: 2024/2/26  9:24
 * @Version 1.0.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@TableName(value = "nexus_comment", autoResultMap = true)
public class Comment {

    public static final LambdaQueryWrapper<Comment> gw() {
        return new LambdaQueryWrapper<>();
    }

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 评论内容
     */
    @TableField(value = "comment_content")
    private String commentContent;


    /**
     * 笔记id/商家id
     */
    @TableField(value = "comment_data_id")
    private Long commentDataId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 评论配图（可多张，分号“；”分割，最多6张）
     */
    @TableField(value = "comment_imgs")
    private String commentImgs;

    /**
     * 评论类型（1.笔记评论，2.商家评论）
     */
    @TableField(value = "comment_type")
    private Byte commentType;

    /**
     * 发布评论地址
     */
    @TableField(value = "create_address")
    private String createAddress;

    /**
     * 父级评论id,如果没有父级评论的话，默认0
     */
    @TableField(value = "parent_id")
    private Long parentId;


    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Boolean isDeleted;

    /**
     * 评论数量
     */
    @TableField(exist = false)
    private Integer commentCount;

    /**
     * 点赞数量
     */
    @TableField(exist = false)
    private Integer likeCount;
}
